<?php
/**
 * Created by PhpStorm.
 * User: zhangrxiang
 * Date: 2016/11/3
 * Time: 10:48
 * Project name: PHPTEST
 * File name: 03.php
 * @copyright Copyright (c) 2016 ZRX Software LLC
 * @license https://github.com/zhangrxiang
 * @since 1.0.0
 */
function callback($buffer)
{
    // replace all the apples with oranges
    return (str_replace("apples", "oranges", $buffer));
}

ob_start("callback");

?>
    <html>
    <body>
    <p>It's like comparing apples to oranges.</p>
    </body>
    </html>
<?php

ob_end_flush();

